

<div class="star" id="star_{$title}_{$row_id}">
    <span>{$content}</span>
    <ul>
        <li><a href="javascript:;">1</a></li>
        <li><a href="javascript:;">2</a></li>
        <li><a href="javascript:;">3</a></li>
        <li><a href="javascript:;">4</a></li>
        <li><a href="javascript:;">5</a></li>
    </ul>
    <span></span>
    <php>if($can !=0){</php>
    <input type="hidden" name="user{$row_id}[{$title}]" id="{$title}" value="">
    <php>}</php>
</div><!--star end-->




<script type="text/javascript">

    $(function () {

        var info = new Array();
        info[1] = '非常差';
        info[2] = '差';
        info[3] = '一般';
        info[4] = '满意';
        info[5] = '非常满意';
        var oStar = document.getElementById("star_{$title}_{$row_id}");
        var aLi = oStar.getElementsByTagName("li");
        var oUl = oStar.getElementsByTagName("ul")[0];
        var oSpan = oStar.getElementsByTagName("span")[1];
        var i = iScore_{$title}_{$row_id} = iStar_{$title}_{$row_id} ={$score};

        fnPoint();

        <php>if($can !=0){</php>
        for (i = 1; i <= aLi.length; i++){
            aLi[i - 1].index = i;
            //鼠标移过显示分数
            aLi[i - 1].onmouseover = function (){
                fnPoint(this.index);
            };

            //鼠标离开后恢复上次评分
            aLi[i - 1].onmouseout = function (){
                fnPoint();
                //关闭浮动层

            };

            //点击后进行评分处理
            aLi[i - 1].onclick = function (){
                iStar_{$title}_{$row_id} = this.index;
                oSpan.innerHTML = "<strong>" + (this.index) + " 分</strong> "+info[this.index];
               $('#star_{$title}_{$row_id} #{$title}').val(this.index);
            }
        }
        <php>}</php>
        //评分处理
        function fnPoint(iArg){
            //分数赋值
            iScore_{$title}_{$row_id} = iArg || iStar_{$title}_{$row_id};
            for (i = 0; i < aLi.length; i++) aLi[i].className = i < iScore_{$title}_{$row_id} ? "on" : "";
        }
    });
</script>